/**
 * 
 */
package com.cloudlead.common.lang.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 映射一对多的情况
 * 
 * 
 * <pre>
 * @HasMany(property = "users")
 * @Domain(domainClassName = "com.lecast.paas.persistence.entity.DeptDomain")
 * public class DeptVO {
 * 	private String name;
 * 
 * 	private Set<UserVO> users;
 * </pre>
 * 
 * @author dean.lu
 * 
 */
@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface HasMany {
	/**
	 * 属性名称
	 * 
	 * @return
	 */
	String property();
	
	/**
	 * 关联字段
	 * 
	 * @return
	 */
	String rootField() default "id";

	/**
	 * 外键关联字段
	 * 
	 * @return
	 */
	String associatedField();
}
